Skip to content

feat: default history views to a 7-day window - #13

Merged
ColeMei merged 1 commit into
mainfrom
feat/history-window
Aug 18, 2026
Merged

feat: default history views to a 7-day window#13
ColeMei merged 1 commit into
mainfrom
feat/history-window

Conversation

@ColeMei

@ColeMei ColeMei commented Aug 18, 2026

Copy link
Copy Markdown
Owner

The Profiles HISTORY panel and the menu-bar popover were showing changes from over a month ago. Root cause: the 90-day retention in record_at only prunes on write, so an install that hasn't changed an association in weeks never prunes at all.

Fixes it by applying the window on read (history::recent_within), and makes the window a user-facing preference.

Behavior

  • Default lookback is 7 days on all three surfaces: Profiles HISTORY, the popover's Recent Changes, and openwith history.
  • Settings → Behavior → "Show history for": 1 week / 1 month / All (persisted as historyWindowDays, shared by both windows).
  • CLI: openwith history --days N and --all.

Nothing is deleted

This is a display window, not a retention change:

  • The ledger keeps its existing 90-day / 500-event cap.
  • The HISTORY panel head shows the active window plus a session-only Show all toggle.
  • undo_change and openwith undo still read the unwindowed ledger, so an event hidden by the window stays revertible.

A "3 months" segment was considered and dropped — the ledger's own 90-day cap makes it indistinguishable from "All".

Verification

Exercised against a running app, not just a compile:

  • Profiles panel shows Last 7 days with the correct empty state; Show all round-trips the hidden rows and flips the head label.
  • Popover reads Nothing in the last 7 days.; its storage listener now refetches rather than only re-rendering, so widening in the main window pulls the extra rows.
  • Settings row renders on one line with 1 week active.
  • CLI: default windowed, --all shows all 24 retained events, --days 60 shows 3, --all --days 3 correctly rejected.

cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test (25, +2 new), and npm run build all clean.

Full GUI smoke-test checklist against a built bundle still pending — see the release notes below.

The 90-day retention in record_at only prunes on write, so an install that
hasn't changed an association in weeks kept showing months-old rows. Apply
the window on read instead, via history::recent_within.

Default is 7 days across all three surfaces (Profiles HISTORY panel, menu-bar
popover, `openwith history`), settable in Settings -> Behavior and via
--days/--all on the CLI. Nothing is deleted: the ledger keeps its 90-day /
500-event cap, the panel offers a session-only "Show all", and undo still
reads the unwindowed ledger so a hidden event stays revertible.
@ColeMei
ColeMei merged commit e19497b into main Aug 18, 2026
1 check passed
@ColeMei
ColeMei deleted the feat/history-window branch August 18, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant